#!/usr/bin/env bash
while true
do

# 执行
python_pid=`ps aux |grep start_court_multiprocess_crawler.py |grep python | grep -w zhixing | awk '{print $2;}'`
if [ "$python_pid" == '' ]; then
    nohup python start_court_multiprocess_crawler.py 'zhixing' 'config/cmb_court.conf' 4  > log/zhixing.log 2>&1 &
fi
echo ${python_pid}

# 执行 通过ID 获取4万5千家数据
python_pid=`ps aux |grep start_court_multiprocess_crawler.py |grep python | grep -w zhixing_id_important | awk '{print $2;}'`
if [ "$python_pid" == '' ]; then
    nohup python start_court_multiprocess_crawler.py 'zhixing_id_important' 'config/cmb_court.conf' 5  > log/zhixing_id_important.log 2>&1 &
fi
echo ${python_pid}

# 执行 通过ID 获取1千万ID数据
#python_pid=`ps aux |grep start_court_multiprocess_crawler.py |grep python | grep -w zhixing_id_need | awk '{print $2;}'`
#if [ "$python_pid" == '' ]; then
#    nohup python start_court_multiprocess_crawler.py 'zhixing_id_need' 'config/cmb_court.conf' 5  > log/zhixing_id_need.log 2>&1 &
#fi
#echo ${python_pid}

# 失信
python_pid=`ps aux |grep start_court_multiprocess_crawler.py |grep python | grep -w shixin | awk '{print $2;}'`
if [ "$python_pid" == '' ]; then
    nohup python start_court_multiprocess_crawler.py 'shixin' 'config/cmb_court.conf' 4  > log/shixin.log 2>&1 &
fi
echo ${python_pid}

# 失信 通过ID 获取数据
python_pid=`ps aux |grep start_court_multiprocess_crawler.py |grep python | grep -w shixin_id_important | awk '{print $2;}'`
if [ "$python_pid" == '' ]; then
    nohup python start_court_multiprocess_crawler.py 'shixin_id_important' 'config/cmb_court.conf' 1  > log/shixin_id_important.log 2>&1 &
fi
echo ${python_pid}

inter_time=10
sleep ${inter_time}
done